home *** CD-ROM | disk | FTP | other *** search
- Path: news.synapse.net!news-admin
- From: phill@synapse.net (Phil Lachance)
- Newsgroups: comp.lang.c++
- Subject: Re: Determining Array size
- Date: Thu, 11 Apr 1996 01:55:22 GMT
- Organization: Chromatic Consulting
- Distribution: world
- Message-ID: <316c6400.108237600@news.synapse.net>
- References: <316a9cef.44425478@news.synapse.net> <4kgl02$gnn@gutemine.informatik.uni-kiel.de>
- NNTP-Posting-Host: violin-10.synapse.net
- X-Newsreader: Forte Agent .99d/32.182
-
- On 10 Apr 1996 15:44:02 GMT, ma@informatik.uni-kiel.de (Martin
- Ameskamp) wrote:
-
- > If we're talking about low-level, C-type arrays - no.
- > The only way to get information about the array size is to call
- > sizeof on the actual array variable (_NOT_ on a pointer that
- > points to the first element of the array).
- >
- > A function that is passed an array as a parameter doesn't know
- > the size (of course, you can explicitly pass the size in a separate
- > parameter or use a special element - like 0 in C strings - to
- > denote the array end or ...)
-
- What I am looking for is a way to determine the size of an array that
- is passed to a template function. I basically want to be able to take
- any array (char, int, float...) and be able to do something to it. I
- want to pass an array and nothing else.
-
-
- _________________________________
- Phil Lachance <phill@synapse.net>
-